import request from '@/router/axios';

export const getList = (current, size, params) => {
    return request({
        url: '/api/mes-product/inspection-document/page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}

export const getDetail = (id) => {
    return request({
        url: '/api/mes-product/inspection-document/detail',
        method: 'get',
        params: {
            id
        }
    })
}

export const remove = (ids) => {
    return request({
        url: '/api/mes-product/inspection-document/remove',
        method: 'post',
        params: {
            ids,
        }
    })
}

export const add = (row) => {
    return request({
        url: '/api/mes-product/inspection-document/submit',
        method: 'post',
        data: row
    })
}

export const update = (row) => {
    return request({
        url: '/api/mes-product/inspection-document/submit',
        method: 'post',
        data: row
    })
}


export const inspect = (row) => {
    return request({
        url: '/api/mes-product/inspection-document/inspect',
        method: 'post',
        data: row
    })
}

/**
 * 合并检验
 */

export const mergeCheck = (ids) => {
    return request({
        url: '/api/mes-product/inspection-document/merging',
        method: 'post',
        params: {
            ids
        }
    })
}

//撤销检验单
export const cancel = (params) => {
    return request({
        url: '/api/mes-product/inspection-document/cancel',
        method: 'get',
        params
    })
}

export const print = (data) => {
    return request({
        url: '/api/mes-product/inspection-document/IQC-print',
        method: 'post',
        data
    })
}

export const urgent = (ids) => {
    return request({
        url: '/api/mes-product/inspection-document/update-urgent',
        method: 'get',
        params: {
            ids
        }
    })
}
